<!doctype html>
<html lang="en">

<head>
	<title>Home</title>
	{%include file="public/head_common" /%}

</head>

<body>

	<!-- MAIN -->
	<div class="main">
		<!-- MAIN CONTENT -->
		<div class="main-content">
			<ul class="breadcrumb">
			    <li>账号管理</li>
			    <li>修改密码</li>
			</ul>
			<div class="container-fluid">
				<form class="form-horizontal">
					
					<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">账号</label>
						<div class="col-sm-4 form-control-static">
							{%$acct.account%}
						</div>
					</div>
					<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">输入新密码</label>
						<div class="col-sm-4">
							<input type="password" class="form-control" name="password" placeholder="密码">
						</div>
					</div>
					<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">再次输入新密码</label>
						<div class="col-sm-4">
							<input type="password" class="form-control" name="repassword" placeholder="重复密码">
						</div>
					</div>
					
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="button" class="btn btn-primary" onclick="save()">确定</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- END MAIN CONTENT -->
	</div>
	<!-- END MAIN -->
	<!-- Javascript -->
	<script src="__STATIC__/assets/vendor/jquery/jquery.min.js"></script>
	<script type="text/javascript">
		
	    function save(){
	    	var data = {
	    		password: $("input[name='password']").val(),
	    		repassword: $("input[name='repassword']").val()
	    	};
	    	// console.log(data);
	    	$.post("{%:url('Account/setHandle')%}",data,function(rsp){
	    		alert(rsp.msg)
	    		if (rsp.code) {
	    			parent.location.href = "{%:url('Login/index')%}";
	    		}
	    	},'json')
	    }
	</script>
	
</body>

</html>